'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const UserSchema = new Schema({
    userId: String,
    userName: String,
    userPwd: String,
    orderList: Array,
    cartList: [
      {
        productId: String,
        productName: String,
        salePrice: String,
        productImage: String,
        checked: String,
        productNum: String,
      },
    ],
    addressList: [
      {
        addressId: String,
        userName: String,
        streetName: String,
        postCode: Number,
        tel: Number,
        isDefault: Boolean,
      },
    ],
  });
  return mongoose.model('User', UserSchema,"users");
};
